<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
    *{
        margin: 0px;
        padding: 0px;
        list-style: none;
    }
    ul{
        overflow: hidden;
    }
    li{
        float: left;
        width:120px;
        text-align: center;
        height: 30px;
        line-height: 30px;
        cursor: pointer;
    }
    div{
        width: 400px;
        height: 300px;
        text-align: center;
        line-height: 300px;
        border:1px solid fuchsia;
        display: none;
    }
 
    li.current{
        background:darksalmon;
        color:white;
    }
    div.current{
        display: block;
    }
</style>
</head>
<body>
    <ul>
            <li class="hao">快手</li>
            <li class>赛道</li>
            <li class>直播</li>
             <li class>电视</li>
      
    </ul>
    <section>
        <div class="hao">快手内容</div>
        <div class>赛道内容</div>
        <div class>直播内容</div>
        <div class>电视内容</div>
    </section>
    <script>
            var tags=document.getElementsByTagName('li');
            var boxs=document.getElementsByTagName('div');
            for(var i=0;i<tags.length;i++){
                tags[i].index=i;
                tags[i].onclick=function(){
                    for(var j=0;j<tags.length;j++){
                        tags[j].className=''
                        boxs[j].className=''
                    }
                    this.className='current';
                    var n=this.index;
                    boxs[n].className='current'
                }
            }
    </script>
    
</body>
</html>